#!/usr/bin/python2.4

import opie
import cgi

print 'Content-type: text/html\n\n'
print
print

id = cgi.FieldStorage().getvalue('id')
o = opie.user_manager()
o2 = o.create_db('localhost', 'dog2dog_corevet', 'edb73a*', 'dog2dog_corevet')
o.db = o.db.cursor()
dd = o.get_all_users()
#print dd.rasta
#print dict(dd)
#dd.func()

#print dd.get_HTML()
# '<head><script type="text/javascript">'
a='''
	function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest){ xmlhttp = new XMLHttpRequest();}
else{
	xmlhttp=newActiveXObject("Microsoft.XMLHTTP");
}
document.getElementById("mydiv1").innerHTML="<p><input type=text>";
}

function run(i){
	loadXMLDoc(i);

}

</script></head>
'''
y=0
print '<table><th>obj_id</th><th>name</th><th>created</th><th>modified</th>'
for z in dd:
	print '<tr><td>'+str(z[0])+'</td><td>'+z[1].username+'</td><td>'+z[2]+'</td><td>'+z[3]+'</td></tr>'
print '</table>'
#	for x in dir(z):
#		a = str(eval('dd.'+x))
#		print '<div id="mydiv'+str(y)+'"><h5>click to edit</h5><p><br>'+x+': '+a+'</div><button type="button" onClick="loadXMLdoc()">edit</button>'
#	y = y+1
print '</body></html>'
